package marvin.swing;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Flow_Layout extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			Flow_Layout dialog = new Flow_Layout();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public Flow_Layout() {
		setTitle(":: FlowLayout ::");
		setIconImage(Toolkit.getDefaultToolkit().getImage(Flow_Layout.class.getResource("/marvin/swing/images/icon/icon.png")));
		setBounds(100, 100, 640, 480);
		setLocationRelativeTo(null);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 12, 15));
		{
			JButton btnNewButton = new JButton("1");
			contentPanel.add(btnNewButton);
		}
		{
			JButton btnNewButton_1 = new JButton("2");
			contentPanel.add(btnNewButton_1);
		}
		{
			JButton btnNewButton_2 = new JButton("3");
			contentPanel.add(btnNewButton_2);
		}
		{
			JButton btnNewButton_3 = new JButton("4");
			contentPanel.add(btnNewButton_3);
		}
		{
			JButton button = new JButton("5");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("6");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("7");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("8");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("9");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("0");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("-");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("+");
			contentPanel.add(button);
		}
		{
			JButton button = new JButton("<-");
			contentPanel.add(button);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okBtn = new JButton("OK");
				okBtn.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						dispose();
					}
				});
				okBtn.setActionCommand("OK");
				buttonPane.add(okBtn);
				getRootPane().setDefaultButton(okBtn);
			}
		}
	}

}
